package com.xhai.common.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author xhai
 * @since 2025-05-24
 */
@Getter
@Setter
@ToString
@TableName("sys_user")
@Schema(name = "SysUser", description = "用户表")
public class SysUser extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @Schema(description = "用户ID")
    @TableId(value = "USER_ID", type = IdType.ASSIGN_ID)
    private Long userId;

    /**
     * 用户账号
     */
    @TableField("USERNAME")
    @Schema(description = "用户账号")
    private String username;

    /**
     * 用户密码
     */
    @TableField("PASSWORD")
    @Schema(description = "用户密码")
    private String password;

    /**
     * 用户类型（00系统用户，01注册用户）
     */
    @TableField("TYPE")
    @Schema(description = "用户类型（00系统用户，01注册用户）")
    private String type;

    /**
     * 电话
     */
    @TableField("PHONE")
    @Schema(description = "电话")
    private String phone;

    /**
     * 昵称
     */
    @TableField("NICKNAME")
    @Schema(description = "昵称")
    private String nickname;

    /**
     * 真实名字
     */
    @TableField("REAL_NAME")
    @Schema(description = "真实名字")
    private String realName;

    /**
     * 头像路径
     */
    @TableField("AVATAR")
    @Schema(description = "头像路径")
    private String avatar;

    /**
     * 加密盐
     */
    @TableField("ENCRYPT_SALT")
    @Schema(description = "加密盐")
    private String encryptSalt;

    /**
     * 最后一次更新密码时间
     */
    @Schema(description = "最后一次更新密码时间")
    @TableField("LAST_PWD_UPDATE_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastPwdUpdateTime;

    /**
     * 备注
     */
    @TableField("REMARK")
    @Schema(description = "备注")
    private String remark;
}
